#ifndef _ADC_ONESHOT_
#define _ADC_ONESHOT_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "soc/soc_caps.h"
#include "esp_log.h"
#include "esp_adc/adc_oneshot.h"
#include "esp_adc/adc_cali.h"
#include "esp_adc/adc_cali_scheme.h"


// 开发板选择
#define KS_S3_KORVO_W   1


//ADC1 Channels
#if KS_S3_KORVO_W
#define UINT_ADC_ID         ADC_UNIT_1
#define ADC1_CHAN4          ADC_CHANNEL_4
#define ADC_ATTEN           ADC_ATTEN_DB_11
#endif

extern void adc1_init(adc_oneshot_unit_handle_t* adc1_handle, adc_cali_handle_t* adc1_cali_chan4_handle);
extern int adc1_read_voltage_val(adc_oneshot_unit_handle_t* adc1_handle, adc_cali_handle_t* adc1_cali_chan4_handle);

#ifdef __cplusplus
} /*extern "C"*/
#endif

#endif